Repository navigation
Conversation
parse-json always yields string object keys; restore decimal integer keys so XQuery map round-trips stay type-faithful on current eXist release. Co-authored-by: Cursor <cursoragent@cursor.com>
line-o
left a comment
There was a problem hiding this comment.
I am not sure if this is safe to do - needs more thinking.
There will be instances were the value "looks" like an integer but needs to stay a string.
|
First of all this is a change in behaviour in exist. So we need to make sure that the new behaviour is not a regresssion. |
|
With this change applied map { "1": 2 }will return as map { 1: 2 }It is much safer to document that object keys have to be strings and will be returned as such. |
line-o
left a comment
There was a problem hiding this comment.
The test needs to change as it relies on wrong interpretation of map key lookups in older versions of exist.
|
my reading is that exits 6 is too permissive and exist 7 is correct. In any case, JWT has failing tests against 7, blocking a jinks on 7. |
I fail to see how this is blocking jinks on 7 since the XAR installs and runs fine |
|
jinks depends on JWT, and JWT is not fully compatible with 7. I have no clue how hard or when this bites. |
|
The test is wrong and always was. Nothing else |
|
@line-o cool, I didn't do a deep dive, this was just drive-by from cleaning up the hsg container, noticing failing tests. |
|
see also https://fiddle.basex.org/?share=('query!'map(1%3A1)%3F%7B*'%7D%2C%5Cnmap(*!*')%3F1')*%5C'1%5C%01*_ QT4 will allow |
Summary
parse-json, restore map keys that are decimal integer strings back toxs:integerso payloads likemap {1: 2}round-trip correctly.existdb/existdb:release(jwt-spec:correct-payload), where JSON object keys are always strings.Test plan
release,6.0.1,5.3.0)docker run -d -p 8080:8080 existdb/existdb:release, thennpm startandnpm test→ 5 passingMade with Cursor